package com.zb.entity.dto;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.zb.entity.ZjAdmModule;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.Date;

/**
 * @Author WEN
 * @Date 2023/7/13 0013
 **/
@Data
@ApiModel("功能模块信息")
public class ModuleInfo {
    @ApiModelProperty(value = "主健ID")
    private Long id;

    @ApiModelProperty(value = "模块编码")
    private String code;

    @ApiModelProperty(value = "模块名称")
    private String name;

    @ApiModelProperty(value = "是否禁用：false-否，true-是")
    private Boolean disabled;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    public static ModuleInfo beanToInfo(ZjAdmModule module) {
        ModuleInfo info = new ModuleInfo();
        BeanUtils.copyProperties(module, info);
        info.setCreateTime(module.getGmtCreate());
        info.setUpdateTime(module.getGmtUpdate());
        return info;
    }
}
